import { Injectable } from '@angular/core';
import { Router ,RouteParams} from '@angular/router-deprecated';
import { BaseRequestOptions,Http,Response, HTTP_PROVIDERS,Headers,URLSearchParams} from '@angular/http';
export class BaseService
{
    headers:Headers;
    public static apiUrl:string = "http://chuxin.fm:443/kapi";
    public static user;
    static isProjectsPage:boolean;
    static isLogin:boolean;
    constructor() {
      this.headers = new Headers();
      this.headers.set('Content-Type', 'application/json');
    }

    authInit(router:Router,callback){
      console.log(BaseService.user);
      if(!BaseService.user)
      {
        BaseService.isLogin = false;
        BaseService.isProjectsPage = true;
        router.navigate(['Login']);
      }else
      {
        callback && callback()
      }
    }
}
